#include<iostream>
#include<signal.h>
#include<unistd.h>


void hander(int sig)
{
    std::cout<<"get a sig: "<<sig<<std::endl;

}
int main()
{
    signal(2,hander);

    while(true)
    {
        std::cout<<"hello world,pid: "<<getpid()<<std::endl;
        sleep(1);
    }
}